import withRouter from 'umi/withRouter';
import { TransitionGroup, CSSTransition } from 'react-transition-group';

function Layout({ location, children }) {
  return (
    <div>
      <TransitionGroup>
        <CSSTransition key={location.pathname} classNames="fade" timeout={300}>
          {children}
        </CSSTransition>
      </TransitionGroup>
    </div>
  );
}

export default withRouter(Layout);
